package chapter01;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class StartAndRunTest {
    public static void main(String[] args) {
        Thread thread = new Thread("t1") {
            @Override
            public void run() {
                try {
                    sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                log.info("running...");
            }
        };
        thread.run();
        System.out.println(thread.getState());
        thread.start();
        thread.start();// 两次连用抛异常
        System.out.println(thread.getState());
        log.info("read other things... ");
    }
}
